package com.zhuiyun.project.api.frontuser.service;

import com.zhuiyun.project.api.frontuser.entity.FrontUser;
import com.zhuiyun.project.api.tag.entity.Tag;
import com.zhuiyun.project.api.frontuser.model.FrontUserModel;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.pageUtil.PageRequest;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
* @Author wb
* @Description 头像上传服务类
* @Date 2023/10/16 20:06
* @Return
*/
public interface FrontUserService {
    /**
     * @Author XMY
     * @Description 前端头像上传
     * @Date 2023/12/11 11:02
     * @Return
     * @param file
     */
    CommonResult headPortraitUpload(MultipartFile file);
    /**
     * @Author XMY
     * @Description 修改用户信息
     * @Date 2023/12/11 16:11
     * @Return
     * @param frontUserModel
     */
    CommonResult updateFrontUser(FrontUserModel frontUserModel) throws CommonException;
    /**
     * @Author XMY
     * @Description 根据id用户信息
     * @Date 2023/12/12 8:28
     * @Return
     * @param userId
     */
    CommonResult getFrontUserById(Integer userId) throws CommonException;
    /**
     * @Author LYX
     * @Description 根据id用户信息
     * @Date 2023/3/6 8:48
     * @Return
     * @param userId
     */
    FrontUser getFrontUserByUserId(Integer userId);
    /**
    * @Author LYX
    * @Description 根据用户名查询用户信息
    * @Date 2024/1/9 16:47
    */
    FrontUser getFrontUserByUserAccount(String userAccount) ;
    /**
     * @Author LYX
     * @Description 根据用户名查询用户信息
     * @Date 2024/3/4 19:27
     */
    Boolean updateOpenid(Integer id, String jg) ;
    /**
     * @Author LYX
     * @Description 根据openid查询用户信息
     * @Date 2024/2/27 16:47
     */
    FrontUser getFrontUserByOpenId(String openid);
    /**
     * @Author LYX
     * @Description 微信登录（用户不存在）新增用户信息
     * @Date 2024/2/28 8:30
     */
     boolean insertFrontUser(FrontUser frontUser);
    /**
     * @Author XMY
     * @Description 根据用户id获取个性标签
     * @Date 2023/12/12 14:27
     * @Return
     * @param userId
     */
    CommonResult getTagListByUserId(Integer userId);
    /**
     * @Author LYX
     * @Description 用户添加个性标签
     * @Date 2024/3/5 19:27
     * @Return
     */
    int insertTag(Tag tag);
    /**
     * @Author LYX
     * @Description 用户添加个性标签
     * @Date 2024/3/5 19:27
     * @Return
     */
    Boolean insertUserTag(int userid,int tagid);
    /**
     * @Author LYX
     * @Description 用户添加邮箱
     * @Date 2024/3/8 8:50
     * @Return
     */
    Boolean updateEmail(String email,int userId);
    /**
     * @Author 雅俗共赏
     * @Description
     * @Date 2024/3/8 15:39
     * @Return
     *  根据用户的code获取openId
     */
    String CodeOpen(String code);
    /**
     * @Author XMY
     * @Description 添加/修改用户信息邮箱校验
     * @Date 2023/12/15 15:08
     * @Return
     * @param email
     */
    CommonResult verifyEmail(String email);
    /**
     * @Author XMY
     * @Description 校验邮箱验证码
     * @Date 2023/12/13 14:22
     * @Return
     * @param email
     * @param code
     */
    CommonResult judgeCode(String email, String code)throws CommonException;
    /**
     * @Author XMY
     * @Description 修改用户信息
     * @Date 2023/12/15 9:51
     * @Return
     * @param frontUserModel
     */
    CommonResult updateFrontUserById(FrontUserModel frontUserModel)throws CommonException;
    /**
     * @Author XMY
     * @Description 删除音频信息
     * @Date 2023/12/6 19:43
     * @Return
     * @param userId
     */
    CommonResult delFrontUserById(Integer[] userId) throws CommonException;
    /**
     * @Author XMY
     * @Description 新增用户
     * @Date 2023/12/14 20:27
     * @Return
     * @param frontUserModel
     */
    CommonResult addFrontUser(FrontUserModel frontUserModel)throws CommonException;
    /**
     * @Author XMY
     * @Description 前台用户管理
     * @Date 2023/12/14 14:46
     * @Return
     * @param frontUser
     * @param pageRequest
     */
    CommonResult getFrontUserList(FrontUser frontUser, PageRequest pageRequest);
    /**
     * @Author XMY
     * @Description 导出接口
     * @Date 2023/12/15 10:47
     * @Return
     * @param response
     */
    void export(HttpServletResponse response)throws Exception ;
    Boolean importData(MultipartFile file) throws Exception;
    /**
     * @Author LYX
     * @Description 用户修改密码
     * @Date 2024/3/20 16:11
     * @Return
     * @param frontUserModel
     */
    CommonResult updatePassword(FrontUserModel frontUserModel);
}
